import request from '@/utils/request'

// 定义公共的api 
const BASE_URL = '/system/student';

export default {
    // 查询用户和分页
    getPageInfo(page, limit, searchObj) {
        return request({
            url: `${BASE_URL}/${page}/${limit}`,
            method: 'get',
            params: searchObj
        })
    },
    
    getStudent(gender) {
        return request({
            url: `${BASE_URL}/getStudent/${gender}`,
            method: 'get',
            
        })
    },
    // 添加或者修改
    saveOrUpdate(student) {
        return request({
            url: `${BASE_URL}/saveOrUpdate`,
            method: 'post',
            data: student
        })
    },

    
    // 学号唯一性判断
    selectByName(no) {
        return request({
            url: `${BASE_URL}/selectByNo/${no}`,
            method: 'get'
        })
    },



    // 根据id去得到一个用户 
    getById(id) {
        return request({
            url: `${BASE_URL}/findById/${id}`,
            method: 'get'
        })
    },

    // 根据id去删除一个用户
    removeById(id) {
        return request({
            url: `${BASE_URL}/remove/${id}`,
            method: 'delete'
        })
    },

}